package Pro;

import java.util.Hashtable;

public class MyFruitStore {
    private static Hashtable Fruittable = new Hashtable<Integer, MyFruit>();
    public static void Add(Integer key, MyFruit fruit){
        Fruittable.put(key,fruit);     //通过货架号添加水果
    }
    public static MyFruit Get(Integer key) throws CloneNotSupportedException {
        MyFruit fruit = (MyFruit) Fruittable.get(key);
        return (MyFruit) fruit.clone();
    }

}
